Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue removal of custom script code in ClassNode in Painless #52495

Merged
merged 18 commits into from
Feb 20, 2020

Conversation

jdconrad
Copy link
Contributor

This continues down the path of removing custom code required for Elasticsearch Painless scripts from the user and ir nodes. This change uses ir nodes to inject gets methods, needs methods, and the bootstrap method as required. There is no reason for the SClass/ClassNode to know about these specific items.

Though, these appear as separate phases for now, this is purely transitional. Eventually, these will be rolled into a single "build" phase where the user tree is semantically checked and converted into an ir tree. This intermediate step is necessary to make the changes occur in smaller consumable steps.

@jdconrad jdconrad added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring v8.0.0 labels Feb 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Scripting)

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

import static org.elasticsearch.painless.WriterConstants.CLASS_TYPE;
import static org.elasticsearch.painless.WriterConstants.DEFINITION_TYPE;
import static org.elasticsearch.painless.WriterConstants.DEF_BOOTSTRAP_DELEGATE_METHOD;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove these constants from the code now right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Good catch.

@jdconrad
Copy link
Contributor Author

@rjernst Thanks for the review!

Copy link
Contributor

@stu-elastic stu-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks for walking me through this.

@jdconrad
Copy link
Contributor Author

@stu-elastic Thanks for the review.

@jdconrad jdconrad merged commit 303aaf4 into elastic:master Feb 20, 2020
@jdconrad
Copy link
Contributor Author

Relates to #49869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants